<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="f" uri="http://www.springframework.org/tags/form"%>

<div class="panel panel-primary">
	<div class="panel-heading">
		<h3 class="panel-title">请输入正确的信息</h3>
	</div>
	<div class="panel-body">
		<f:form action="${param.action}" method="${param.method}" id="user"
			cssClass="form-horizontal" modelAttribute="user">
			<f:hidden path="id"/>
			<div class="form-group">
				<f:label path="name" cssClass="col-md-2 control-label"><s:message code="model.user.name" /></f:label>
				<div class="col-md-10">
					<f:input path="name" cssClass="form-control" required="required" placeholder="名字长度介于2-20之间"/>
				</div>
			</div>
			<div class="form-group">
                <f:label path="password" cssClass="col-md-2 control-label"><s:message code="model.user.password" /></f:label>
                <div class="col-md-10">
                    <f:password path="password" cssClass="form-control" required="required" placeholder="请记住自己的密码" />
                </div>
            </div>
			<div class="form-group">
				<f:label path="email" cssClass="col-md-2 control-label"><s:message code="model.user.email" /></f:label>
				<div class="col-md-10">
					<f:input path="email" cssClass="form-control" required="required" type="email" placeholder="暂时部支持Gmail邮箱" />
				</div>
			</div>
            <div class="form-group">
                <f:label path="telephone" cssClass="col-md-2 control-label"><s:message code="model.user.telephone" /></f:label>
                <div class="col-md-10">
                    <f:input path="telephone" cssClass="form-control" cssErrorClass="has-error" type="phone" required="required" placeholder="可以不用加国家编号"/>
                </div>
            </div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary">
					   <c:choose>
					       <c:when test="${user.id == null}">
					           <s:message code="views.label.submit" />
					       </c:when>
					       <c:otherwise>
					            <s:message code="views.label.update" />
					       </c:otherwise>
					   </c:choose>
					</button>
				</div>
			</div>
		</f:form>
	</div>
	<div class="panel-footer"></div>
</div>
